import React from 'react'
import { NavBar } from 'antd-mobile-v5'
import { useNavigate } from "react-router-dom";

import './index.scss'
// useNavigate 只能在函数组件里使用
function MyNavBar(props:any) {
  const navigate = useNavigate()
  return (
    <div className='navBar'>
      <NavBar onBack={() => navigate(-1)}>{props.title || '好客租房'}</NavBar>
      
    </div>
    
  )
}

export default MyNavBar